package org.yxj.requestlibaray.i;

import org.yxj.requestlibaray.bean.TokenResponse;
import java.util.Map;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.QueryMap;
import rx.Observable;

public interface MeServer  {



    /**
     * get 请求
     *
     * @param map
     * @return
     */
    @GET("{api}")
    Observable<Object> HomeGoodsList(@Path("api") String path ,@QueryMap Map<String,Object> map);





    @POST("{api}")
    Observable<Object> api(@Path("api") String api, @Body RequestBody body);



    /**
     * 获取token
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST(Api.token)
    Observable<TokenResponse> token(@FieldMap Map<String,Object> map);

    /**
     * 获取token
     *
     * @param map
     * @return
     */
    @GET(Api.HomeGoodsList)
    Observable<Object> HomeGoodsListTask(@QueryMap Map<String,Object> map);

    /**
     * 获取token
     *
     * @param map
     * @return
     */
    @GET(Api.loginByPassword)
    Observable<Object> loginByPasswordTask(@QueryMap Map<String,Object> map);

}
